package com.beaut.project.aop;

import java.io.IOException;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.springframework.stereotype.Component;


@Component
@Aspect
public class FlowBackCallAspect {
		public FlowBackCallAspect(){
			System.out.println();
		}
    	@Around("execution (* com.beaut.project.control.WorkFlowController.back*(..)) && args(request,response)")
	    public String aroundFlowException(ProceedingJoinPoint jp,HttpServletRequest request,HttpServletResponse response) {
    		try {
    			jp.proceed();
    		} catch (Throwable e) {
    			e.printStackTrace();
    			try {
					response.getWriter().print(-100);
				} catch (IOException e1) {
					// TODO Auto-generated catch block
					e1.printStackTrace();
				}
    		}
        	return null;
	    }
}
